﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO
{
    /// <summary>
    /// 消费项目表
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class consume_item_dto
    {
        /// <summary>
        /// 消费项目Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 消费项目类型（枚举）
        /// </summary>
        public EConsumeItemType consume_type { get; set; }

        /// <summary>
        /// 消费项目类型枚举描述
        /// </summary>
        public string consume_type_title { get { return this.consume_type.ToDescription(); } }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 点击数
        /// </summary>
        public int click_num { get; set; }

        /// <summary>
        /// 参与数
        /// </summary>
        public int participation_num { get; set; }

        /// <summary>
        /// 是否停用
        /// </summary>
        public bool disabled { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get; set; }

        /// <summary>
        /// 是否在AppStore版本中显示
        /// </summary>
        public bool is_app_store_show { get; set; }

        /// <summary>
        /// 适用于(枚举)
        /// </summary>
        public EConsumeItemApply apply { get; set; }

        /// <summary>
        /// 适用于枚举描述
        /// </summary>
        public string apply_title { get { return this.apply.ToDescription(); } }

        /// <summary>
        /// Url地址
        /// </summary>
        public string url { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int sort { get; set; }
    }


    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class consume_item_dto_ex : consume_item_dto
    {
        /// <summary>
        /// 消费类型枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_consume_type_list
        {
            get { return typeof(EConsumeItemType).GetDropdownItemList(); }
        }

        /// <summary>
        /// 消费类型枚举值
        /// </summary>
        public string consume_type_value { get; set; }

        /// <summary>
        /// 是否停用value值
        /// </summary>
        public string disabled_value { get; set; }

        /// <summary>
        /// 适用于枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_apply_list
        {
            get { return typeof(EConsumeItemApply).GetDropdownItemList(); }
        }

        /// <summary>
        /// 适用于枚举值
        /// </summary>
        public string apply_value { get; set; }
    }


    /// <summary>
    /// app消费项目
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class app_consume_item_dto
    {
        /// <summary>
        /// 消费项目Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 消费项目类型（1:油卡充值, 2:商品兑换）
        /// </summary>
        public int consume_type { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        public string img_url { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string detail { get; set; }

        /// <summary>
        /// 是否在AppStore版本中显示
        /// </summary>
        public bool is_app_store_show { get; set; }

        /// <summary>
        /// url
        /// </summary>
        public string url { get; set; }
        /// <summary>
        /// 1 app 2 网页
        /// </summary>
        public int apply { get; set; }
    }

}
